package trc.model;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;

/**
 *
 */
public class Layer implements Serializable {
    public static final String PROP_NAME = "materialName";
    public static final String PROP_LAMBDA = "materialLambda";
    public static final String PROP_THICKNESS = "thickness";

    private String materialName;
    private double materialLambda;
    private double thickness;

    
    public final double getMaterialLambda() {
        return materialLambda;
    }

    public final void setMaterialLambda(double materialLambda) {
        double oldValue = this.materialLambda;
        this.materialLambda = materialLambda;
        pcs.firePropertyChange(PROP_LAMBDA, materialLambda, oldValue);
    }

    public final String getMaterialName() {
        return materialName;
    }

    public final void setMaterialName(String materialName) {
        String oldValue = this.materialName;
        this.materialName = materialName;
        pcs.firePropertyChange(PROP_NAME, materialName, oldValue);
    }

    public final double getThickness() {
        return thickness;
    }

    public final void setThickness(double thickness) {
        double oldValue = this.thickness;
        this.thickness = thickness;
        pcs.firePropertyChange(PROP_THICKNESS, thickness, oldValue);
    }


    private PropertyChangeSupport pcs = new PropertyChangeSupport(this);

    public final void addPropertyChangeListener(PropertyChangeListener listener) {
        pcs.addPropertyChangeListener(listener);
    }

    public final void removePropertyChangeListener(PropertyChangeListener listener) {
        pcs.removePropertyChangeListener(listener);
    }
}